<?php $this->beginContent('//layouts/main'); ?>
<?php 
	$r = $_GET['r'];
	$list = array();
	if ($r == 'room')
	{
		$list = $this->roomList->getData();
	}
	else  if (!empty($_GET["type"]))
	{
		$list = $this->getContents($_GET["type"])->getData();
	}
	$favs = $this->getIndexFavs(10)->getData();
	$isGuest = Yii::app()->user->isGuest;
?>
<!--页面主体-->
<div class="kf-gj">
	<div style="height:45px;"></div>
	<div class="kf">
		<div class="fl kf-left">
			<div><img src="images/guild.jpg" /></div>
			<div class="ml10 yd">
				<div class="kf-square"></div><p class="kf-title">预订摘要</p>
				<?php
					if (!empty($_SESSION["in_date"]))
					{
						echo '<p class="fwb">入住时间</p>';
						echo '<p>'.$_SESSION["in_date"].'</p>';
					}
					if (!empty($_SESSION["out_date"]))
					{
						echo '<p class="fwb">退房时间</p>';
						echo '<p>'.$_SESSION["out_date"].'</p>';
					}
					if (!empty($_SESSION["room_count"]))
					{
						echo '<p class="fwb">房数：';
						echo $_SESSION["room_count"].'</p>';
					}
					if (!empty($_SESSION["room_type_name"]))
					{
						echo '<p class="fwb">房型：'.$_SESSION["room_type_name"].'</p>';
					}
					if (!empty($_SESSION["bed_type"]))
					{
						if ($_SESSION["bed_type"] == 1)
							echo '<p class="fwb">床型：大床</p>';
						else 
							echo '<p class="fwb">床型：双床</p>';
					}
				?>
				<p class="mt10">
					<center>
						<a class="c-t-e" href="?r=user/member">会员中心</a>&nbsp;|&nbsp;
						<a class="c-t-e" href="?r=order/list">我的预订</a>
					</center>
				</p>
			</div>
			<div class="ml10">
				<div class="kf-square"></div>
				<p class="kf-title">在线预订</p>
				<form action="?r=order/step1" method="post">
				<p class="mt10">入住时间</p>
				<p class="mt5">
					<input type="text" onClick="WdatePicker()" name="in_date" class="index-df-input " value="<?php if (!empty($_SESSION["in_date"])) echo $_SESSION["in_date"]?>" />
				</p>
				<p class="mt10">退房时间</p>
				<p class="mt5">
					<input type="text" onClick="WdatePicker()" name="out_date" class="index-df-input" value="<?php if (!empty($_SESSION["out_date"])) echo $_SESSION["out_date"]?>" />
				</p>
				<div class="mt10">
					<p>选择房型</p>
					<p class="mt5">
						<select class="index-df-input" name="room_type" >
							<?php 
								foreach ($this->roomList->getData() as $key => $value) {
									echo '<option value='.$value['id'].'>';
									echo $value["name"];
									echo '</option>';
								}
							?>
						</select>
					</p>
					<p class="mt10">
					<center>
					<?php if (!$isGuest) : ?>
						<input class="order_button" type="submit" value="立即预定" />
					<?php endif; ?>
					<?php if ($isGuest) : ?>
						<a href="javascript:void(0)" id="loginOrder2">
							<input class="order_button" type="button" value="登录预定" />
						</a>
					<?php endif; ?>
					</center>
					</form>
					</p>
					<?php if ($isGuest) : ?>
						<p class="mt5 mb5">想获得更多优惠，请<a id="register_c" class="c-t-c"
						style="margin-left: 0px;" href="javascript:void(0)">加入青城会。</a></p>
					<?php endif; ?>
				</div>
			</div>
			<div class="mt20 mb10"><img src="images/bj-bk.png" /></div>
			<div class="ml10">
				<div class="kf-square"></div>
				<p class="kf-title">官方微博</p>
				<p class="mt10">
					<a class="ml20" target="_blank" href="http://e.weibo.com/2630059361/app_2271874732"><img src="images/1.png" /></a>
					<a class="ml20" target="_blank" href="http://e.t.qq.com/hojoqc"><img src="images/2.png" /></a>
					<a class="ml20" target="_blank" href="http://www.facebook.com/319734091408528"><img src="images/4.png" /></a>
				</p>
			</div>
			<div class="mt20 mb10"><img src="images/bj-bk.png" /></div>
			<div class="ml10">
				<div class="kf-square"></div>
				<p class="kf-title">联系我们</p>
				<div class="kf-phone">
					<p>预订热线</p>
					<p><i class="f20">86-028-8719-78677</i></p>
					<p>电话：86-028-8898 8888</p>
					<p>传真：86-028-8728 8222</p>
					<p>邮箱：info@hojoqc.com</p>
				</div>
			</div>
		</div>
		<?php echo $content; ?>
		<div class="fl kf-right">
			<div>
				<h1>&nbsp;&nbsp;特别优惠</h1>
			</div>
			<?php 
				foreach ($favs as $key => $value) {
					echo '<div class="mt10"> ';
					echo '<a href="?r=fav&id='.$value["id"].'" style="color:#000">';
					echo '<img width="189" height="119" src="'.$value["image"].'" />';
					echo '<p class="fwb">'.$value["title"].'</p>';
					echo '<p>';
					if (strlen($value["content"]) > 30)
					{
						
						echo $this->utf_substr($value["content"], 60).'...';
					}
					else
					{
						echo $value["content"];
					}
					echo '</p>';
					echo '</a></div>';
				}
			?>
		</div>
	</div>
</div>
<!--页面主体结束--> 
<?php $this->endContent(); ?>